package daobeauty.interceptor.returntype.executor.query;

import org.hibernate.Query;

import daobeauty.dao.Limiting;
import daobeauty.interceptor.returntype.handler.ReturnTypeHandler;

/**
 * This interface defines a strategy for executing Queries.
 * The given ReturnTypeHandler is responsible of converting the result of the query
 * to the type, which the proxied method has to return.
 * Also the Limiting has to be applied to the Query.<br/>
 * Different execution strategies may consist of calling Query.list(), Query.uniqueResult() or Query.scroll().<br/>
 * Queries don't support additional sorting outside of the defined HQL-query.
 * 
 * @author M. Serhat Cinar
 *
 */
public interface QueryExecutionStrategy {
	public Object execute(ReturnTypeHandler returnTypeHandler, Query query, Limiting limiting);
}
